package com.allwees.bs.module.oms.mq.listener;

import com.allwees.bs.module.oms.service.GeneralOmsOrderItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RabbitListener(queues = "q.C.OrderItem.Reviewed")
public class OrderItemReviewedListener {

    @Autowired
    private GeneralOmsOrderItemService generalOmsOrderItemService;

    @RabbitHandler
    public void onEvent(String orderItemUuid) {
        log.info("============ q.C.OrderItem.Reviewed=========================  orderItemUuid: {} ",orderItemUuid);
        generalOmsOrderItemService.doReviewed(orderItemUuid);
        log.info("============ q.C.OrderItem.Reviewed end ===================== orderItemUuid: {} ",orderItemUuid);
    }
}
